#include <Game/Include/InstallBlockGameEvent.h>


InstallBlockGameEvent::InstallBlockGameEvent(const float &pos_x, const float &pos_y, const float &width, const float &height)
    :GameEvent(GameEventType::INSTALL_BLOCK_EVENT)
{
    this->pos_x = pos_x;
    this->pos_y = pos_y;
    this->width = width;
    this->height = height;
}

InstallBlockGameEvent::InstallBlockGameEvent(std::istream &s)
    :GameEvent(s)
{
    ISerializable::read(s, this->pos_x);
    ISerializable::read(s, this->pos_y);
    ISerializable::read(s, this->width);
    ISerializable::read(s, this->height);
}

InstallBlockGameEvent::~InstallBlockGameEvent(void)
{
}

unsigned int InstallBlockGameEvent::serialize(std::ostream &s)
{
    unsigned int bytes_written = GameEvent::serialize(s);
    bytes_written += ISerializable::write(s, this->pos_x);
    bytes_written += ISerializable::write(s, this->pos_y);
    bytes_written += ISerializable::write(s, this->width);
    bytes_written += ISerializable::write(s, this->height);
    return bytes_written;
}

float InstallBlockGameEvent::getPosX() const
{
    return this->pos_x;
}

float InstallBlockGameEvent::getPosY() const
{
    return this->pos_y;
}

float InstallBlockGameEvent::getWidth() const
{
    return this->width;
}

float InstallBlockGameEvent::getHeight() const
{
    return this->height;
}
